<?php
namespace app\admin\validate;

use think\Validate;

class MenuList extends Validate{
    //验证规则
    protected $rule = [
        'list_name'  => 'require',
        'module' => 'require',
        'controller' => 'require',
        'function' => 'require',
        'frame_url' => 'unique:MenuList',
    ];

    //提示信息
    protected $message = [
        'list_name.require'  => '栏目名称不能为空！',
        'module.require'  => '栏目模块不能为空！',
        'controller.require'  => '栏目控制器不能为空！',
        'function.require'  => '栏目方法不能为空！',
        'frame_url.unique'  => '地址已存在！',
    ];

    //验证场景
    protected $scene=[
        'add_menu_list'=>[
            'list_name' ,
            'module' ,
            'controller' ,
            'function' ,
            'frame_url' ,
        ],
        'edit_menu_list'=>[
            'list_name' ,
            'module' ,
            'controller' ,
            'function' ,
            'frame_url' ,
        ],
    ];
}